<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20110101;13565600">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>decsoltripiv</B></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal">Given the </SPAN><I>nXn</I><SPAN STYLE="font-style: normal"> </SPAN><SPAN STYLE="font-style: normal">tridiagonal matrix T (T_{i,j}=0 for |i-j| &gt; 1) attempts to obtain a lower bidiagonal matrix L (L_{i,j}=0 for i&gt;j+1) and uniti upper band matrix (with at most two codiagonals) U (U_{i,i}=1, U_{i,j}=0 for i&gt;j and j&gt;i+2) such that LU=PT where P is a permutation matrix, </SPAN></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US">for details see book of Hang T. Lau, “A Java Numerical Library for Scientists and engineers|”, Chapman &amp; Hall, 2004</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to open the editor)</B></SPAN></FONT>


<SPAN LANG="en-US">import java.text.DecimalFormat;</SPAN>
<SPAN LANG="en-US">import numal.*;</SPAN>

<SPAN LANG="en-US">public class Test_decsoltripiv extends Object {</SPAN>
<SPAN LANG="en-US">	</SPAN>
<SPAN LANG="en-US">	public static void main(String args[]) {</SPAN>

    <SPAN LANG="en-US">int i;</SPAN>
    <SPAN LANG="en-US">double d[] = new double[31];</SPAN>
    <SPAN LANG="en-US">double sub[] = new double[31];</SPAN>
    <SPAN LANG="en-US">double supre[] = new double[31];</SPAN>
    <SPAN LANG="en-US">double b[] = new double[31];</SPAN>
    <SPAN LANG="en-US">double aux[] = new double[6];</SPAN>
    
    <SPAN LANG="en-US">for (i=1; i&lt;=30; i++) {</SPAN>
      <SPAN LANG="en-US">sub[i]=i*2;</SPAN>
      <SPAN LANG="en-US">supre[i]=i;</SPAN>
      <SPAN LANG="en-US">d[i]=i+10;</SPAN>
      <SPAN LANG="en-US">b[i]=0.0;</SPAN>
    <SPAN LANG="en-US">}</SPAN>
    <SPAN LANG="en-US">b[1]=1.0;  b[2]=12.0;  b[3]=4.0;</SPAN>
    <SPAN LANG="en-US">aux[2]=1.0e-6;</SPAN>
    <SPAN LANG="en-US">Linear_algebra.decsoltripiv(sub,d,supre,30,aux,b);</SPAN>
    <SPAN LANG="en-US">b[2]--;</SPAN>
    <SPAN LANG="en-US">DecimalFormat fiveDigit = new DecimalFormat(&quot;0.00000E0&quot;);</SPAN>
    <SPAN LANG="en-US">System.out.println(&quot;AUX[3] and AUX[5]:  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(aux[3]) + &quot;  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(aux[5]) +</SPAN>
      <SPAN LANG="en-US">&quot;\nError in the solution:  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(Math.sqrt(Basic.vecvec(1,30,0,b,b))));</SPAN>
  <SPAN LANG="en-US">}</SPAN>
<SPAN LANG="en-US">}</SPAN></PRE>
</BODY>
</HTML>